Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TF-3385 Update UI by user actions before web socket #3390

Conversation

tddang-linagora
Copy link
Contributor

@tddang-linagora tddang-linagora commented Dec 31, 2024

Issue

Implement details

  • Each task will coordinate with 1 commit
  • If a task doesn't require any change, its description will be crossed
  • In progress task's description will be bold

Changes

MailboxController

  • RenameMailboxSuccess
  • CreateDefaultMailboxAllSuccess
  • MarkAsEmailReadSuccess || MarkAsMultipleEmailReadAllSuccess || MarkAsMultipleEmailReadHasSomeEmailFailure
  • MoveToMailboxSuccess || MoveMultipleEmailToMailboxAllSuccess || MoveMultipleEmailToMailboxHasSomeEmailFailure
  • DeleteEmailPermanentlySuccess || DeleteMultipleEmailsPermanentlyAllSuccess || DeleteMultipleEmailsPermanentlyHasSomeEmailFailure
  • EmptyTrashFolderSuccess || EmptySpamFolderSuccess
  • SaveEmailAsDraftsSuccess || UpdateEmailDraftsSuccess || RemoveEmailDraftsSuccess
  • GetRestoredDeletedMessageSuccess

SearchEmailController

  • MarkAsEmailReadSuccess || MarkAsMultipleEmailReadAllSuccess || MarkAsMultipleEmailReadHasSomeEmailFailure
  • MarkAsStarEmailSuccess || MarkAsStarMultipleEmailAllSuccess || MarkAsStarMultipleEmailHasSomeEmailFailure
  • MoveToMailboxSuccess || MoveMultipleEmailToMailboxAllSuccess || MoveMultipleEmailToMailboxHasSomeEmailFailure
  • DeleteEmailPermanentlySuccess || DeleteMultipleEmailsPermanentlyAllSuccess || DeleteMultipleEmailsPermanentlyHasSomeEmailFailure
  • EmptyTrashFolderSuccess || EmptySpamFolderSuccess
  • UnsubscribeEmailSuccess
  • StoreEventAttendanceStatusSuccess

SearchMailboxController

  • MarkAsMailboxReadAllSuccess || MarkAsMailboxReadHasSomeEmailFailure
  • RenameMailboxSuccess

ThreadController

  • MarkAsEmailReadSuccess || MarkAsMultipleEmailReadAllSuccess || MarkAsMultipleEmailReadHasSomeEmailFailure || MarkAsMailboxReadAllSuccess || MarkAsMailboxReadHasSomeEmailFailure
  • MarkAsStarEmailSuccess || MarkAsStarMultipleEmailAllSuccess || MarkAsStarMultipleEmailHasSomeEmailFailure
  • MoveToMailboxSuccess || MoveMultipleEmailToMailboxAllSuccess || MoveMultipleEmailToMailboxHasSomeEmailFailure
  • DeleteEmailPermanentlySuccess || DeleteMultipleEmailsPermanentlyAllSuccess || DeleteMultipleEmailsPermanentlyHasSomeEmailFailure
  • SaveEmailAsDraftsSuccess || UpdateEmailDraftsSuccess || RemoveEmailDraftsSuccess
  • EmptyTrashFolderSuccess || EmptySpamFolderSuccess
  • SendEmailSuccess
  • UnsubscribeEmailSuccess
  • StoreEventAttendanceStatusSuccess

Copy link

This PR has been deployed to https://linagora.github.io/tmail-flutter/3390.

@dab246
Copy link
Member

dab246 commented Jan 2, 2025

  • Emtpy view appears when permanently deleting 20 emails out of a total of more than 200 emails in Trash/Spam/Draft.
Screen.Recording.2025-01-02.at.11.16.36.mov

@dab246
Copy link
Member

dab246 commented Jan 2, 2025

  • Mark as star work incorrect when make step: mark as star email in Inbox folder -> open Sent folder -> mark as star email -> open Inbox folder
Screen.Recording.2025-01-02.at.11.30.05.mov

@tddang-linagora
Copy link
Contributor Author

Emtpy view appears when permanently deleting 20 emails out of a total of more than 200 emails in Trash/Spam/Draft.

should-show-loading-when-waiting-for-ws.mov
should-show-loading-when-waiting-for-ws.in.trash.mov

@tddang-linagora
Copy link
Contributor Author

Mark as star work incorrect when make step: mark as star email in Inbox folder -> open Sent folder -> mark as star email -> open Inbox folder

should.keep.flag.status.after.chaging.mailbox.mov

@tddang-linagora
Copy link
Contributor Author

Mark as unread email in Email View doesn't work.

mark.as.read.and.unread.work.mov

@tddang-linagora
Copy link
Contributor Author

Undo action not work when drag & drop multiple emails to folder

move.and.undo.work.in.normal.mode.mov
move.and.undo.work.in.search.mov

@tddang-linagora
Copy link
Contributor Author

Email item not updated when make some actions (mark as read/unread/star/move) in search on desktop

read.star.move.in.search.work.mov

Copy link
Member

@dab246 dab246 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

** Note: Web socket disabled

  • Mark as multiple email read not work
mark-as-multiple-email-read.mov
  • Mark as star in Email View not work
mark-as-star-email-view.mov
  • Mark as star/mark as read multiple email not work in search on mobile responsive web
mark-as-star-read-multiple-email-in-search-mobile-responsive.mov
  • Auto back thread view when preview email in search view
auto-back-thread-view-when.back-preview-email.mov

Comment on lines 99 to 103
return Future.wait(emailsCache.map((emailCache) => storeEmail(
accountId,
userName,
emailCache,
)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't use Future.wait let's use store multiple value to box of hive

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 247 to 259
await mapDataSource[DataSourceType.local]!.markAsMailboxRead(
session,
accountId,
mailboxId,
totalEmailUnread - result.length,
onProgressController,
);
await emailDataSource?.markAsRead(
session,
accountId,
result,
ReadActions.markAsRead,
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do them simultaneously.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 25 to 34
Map<MailboxId, List<EmailId>> get emailIdsByMailboxId => Map.from(
where((email) => email.mailboxContain?.mailboxId != null && email.id != null)
.fold(<MailboxId, List<EmailId>>{}, (combine, email) {
final mailboxId = email.mailboxContain!.mailboxId!;
combine[mailboxId] ??= [];
combine[mailboxId]!.add(email.id!);
return combine;
}
),
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Map<MailboxId, List<EmailId>> get emailIdsByMailboxId => Map.from(
where((email) => email.mailboxContain?.mailboxId != null && email.id != null)
.fold(<MailboxId, List<EmailId>>{}, (combine, email) {
final mailboxId = email.mailboxContain!.mailboxId!;
combine[mailboxId] ??= [];
combine[mailboxId]!.add(email.id!);
return combine;
}
),
);
Map<MailboxId, List<EmailId>> get emailIdsByMailboxId {
final Map<MailboxId, List<EmailId>> result = {};
for (final email in this) {
final mailboxId = email.mailboxContain?.mailboxId;
final emailId = email.id;
if (mailboxId != null && emailId != null) {
(result[mailboxId] ??= []).add(emailId);
}
}
return result;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 372 to 379
_checkIfCurrentMailboxCanLoadMore();
} else if (reactionState is DeleteEmailPermanentlySuccess
|| reactionState is DeleteMultipleEmailsPermanentlyAllSuccess
|| reactionState is DeleteMultipleEmailsPermanentlyHasSomeEmailFailure
) {
WidgetsBinding.instance.addPostFrameCallback((_) {
_checkIfCurrentMailboxCanLoadMore();
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a place for WidgetsBinding.instance.addPostFrameCallback when there isn't one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

final currentMailbox = mailboxDashBoardController.selectedMailbox.value;
if (currentMailbox == null) return;

final totalEmailsCount = currentMailbox.totalEmails?.value.value ?? 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use currentMailbox .countTotalEmails function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@tddang-linagora
Copy link
Contributor Author

Mark as multiple email read not work

Please check again. No code update needed. I can't reproduce it.

Mark.as.read.by.select.all.mov

@tddang-linagora
Copy link
Contributor Author

Mark as star in Email View not work

Screen.Recording.2025-01-03.at.17.02.20.mov

@tddang-linagora
Copy link
Contributor Author

Mark as star/mark as read multiple email not work in search on mobile responsive web

Mark.read.and.star.mobile.search.mov

@tddang-linagora
Copy link
Contributor Author

Auto back thread view when preview email in search view

Not a bug from this PR. Reproducible on maintenance-v0.14.2

@hoangdat hoangdat changed the title [Version 2] TF-3385 Update UI by user actions before web socket TF-3385 Update UI by user actions before web socket Jan 3, 2025
@hoangdat hoangdat merged commit eed47e2 into maintenance-v0.14.2 Jan 3, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants